22 template <class T
> string
toStr(const T
&x
){ stringstream s
; s
<< x
; return s
.str(); }
23 template <class T
> int toInt(const T
&x
){ stringstream s
; s
<< x
; int r
; s
>> r
; return r
; }
25 #define For(i, a, b) for (int i=(a); i<(b); ++i)
26 #define foreach(x, v) for (typeof (v).begin() x = (v).begin(); x != (v).end(); ++x)
27 #define D(x) cout << #x " is " << x << endl
35 m
= random() % 64 + 1;
38 vector
<string
> prefixes
;
40 printf("%d %d\n", n
, m
);
41 for (int i
=0; i
<n
; ++i
){
42 int len
= random() % m
+ 1;
44 for (int i
=0; i
<len
; ++i
){
45 char c
= random() % 2 + '0';
49 prefixes
.push_back(s
);
52 prefixes
.push_back("*");
58 cout
<< prefixes
[random() % prefixes
.size()] << endl
;